﻿<%@ Page Title="" Language="C#" Theme="Default_Themes" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="UpdateCoSoDoan.aspx.cs" Inherits="DanhMuc_QuanLyCoSoDoan" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="udt1" runat="server">
        <ContentTemplate>
            <asp:Panel ID="pncontent" runat="server">
                <div class="row-fluid">
                    <div class="span12">
                        <div class="box">
                            <div class="box-title">
                                <h3><i class="icon-file"></i>Cập nhật đơn vị</h3>
                                <div class="box-tool">
                                    <a data-action="collapse" href="#"><i class="icon-chevron-up"></i></a>
                                    <a data-action="close" href="#"><i class="icon-remove"></i></a>
                                </div>
                            </div>
                            <div class="box-content" style="border: 1px solid #B6D1F2;">
                                <div style="height: 10px;"></div>
                                <asp:LinkButton ID="btnedit" OnClick="btnedit_Click1" class="btn btn-primary" runat="server"><i class="icon-wrench"></i>&nbsp;&nbsp;Chỉnh sửa thông tin</asp:LinkButton>
                                <asp:LinkButton ID="btndanhgia" OnClick="btndanhgia_Click1" class="btn btn-success " runat="server"><i class=" icon-thumbs-up-alt"></i>&nbsp;&nbsp;Đánh giá</asp:LinkButton>
                                <asp:LinkButton ID="btndelete" OnClientClick="return confirm('Bạn có chắc xóa không? Nếu xóa thì tất cả các đoàn viên thuộc cơ sở đoàn này sẽ bị xóa')" OnClick="btndelete_Click1" class="btn btn-danger" runat="server"><i class="icon-trash"></i>&nbsp;&nbsp;Xóa</asp:LinkButton>
                                <asp:LinkButton ID="LinkGiaithedonvi" OnClick="LinkGiaithedonvi_Click" class="btn btn-warning dropdown-toggle" runat="server"><i class="icon-cut"></i>&nbsp;&nbsp;Giải thể đơn vị</asp:LinkButton>
                                <asp:Label ID="lblmessage" runat="server" ForeColor="Red"></asp:Label>
                                <div style="height: 10px;"></div>
                                <asp:GridView ID="grid" runat="server" AutoGenerateColumns="False" Width="100%" DataKeyNames="MaDonVi" EnableTheming="True" CellPadding="4" ForeColor="#333333" GridLines="None">
                                    <AlternatingRowStyle BackColor="White" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="Chọn">
                                            <ItemTemplate>
                                                <asp:RadioButton onclick = "RadioCheck(this);" ID="deletenews" runat="server" AutoPostBack="true" OnCheckedChanged="chkSelect_CheckedChanged" />
                                            </ItemTemplate>
                                            <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Mã Đơn Vị" SortExpression="MaDonVi">
                                            <ItemTemplate>
                                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("MaDonVi") %>'></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="ItemGridCell" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Tên Đơn Vị" SortExpression="TenDonVi">
                                            <ItemTemplate>
                                                <asp:Label ID="Label2" runat="server" Text='<%# Bind("TenDonVi") %>'></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="ItemGridCell" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Địa Chỉ" SortExpression="DiaChi">
                                            <ItemTemplate>
                                                <asp:Label ID="Label3" runat="server" Text='<%# Bind("DiaChi") %>'></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="ItemGridCell" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Điện Thoại" SortExpression="DienThoaiBan">
                                            <ItemTemplate>
                                                <%#Eval("DienThoaiBan")%>-<%#Eval("DienThaoiDiDong") %>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="ItemGridCell" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Fax" SortExpression="Fax">
                                            <ItemTemplate>
                                                <asp:Label ID="Label6" runat="server" Text='<%# Bind("Fax") %>'></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="ItemGridCell" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Email" SortExpression="Email">
                                            <ItemTemplate>
                                                <asp:Label ID="Label7" runat="server" Text='<%# Bind("Email") %>'></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="ItemGridCell" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Website" SortExpression="Website">
                                            <ItemTemplate>
                                                <asp:Label ID="Label8" runat="server" Text='<%# Bind("Website") %>'></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="ItemGridCell" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Lãnh Đạo" SortExpression="LanhDao">
                                            <ItemTemplate>
                                                <asp:Label ID="Label9" runat="server" Text='<%# Bind("LanhDao") %>'></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="ItemGridCell" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Nghị Quyết" SortExpression="NghiQuyet">
                                            <ItemTemplate>
                                                <asp:Label ID="Label11" runat="server" Text='<%# Bind("NghiQuyet") %>'></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="ItemGridCell" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Ngày Thành Lập" SortExpression="NgayThanhLap">
                                            <ItemTemplate>
                                                <%# (Eval("NgayThanhLap")!=null?string.Format("{0:dd/MM/yyyy}",Eval("NgayThanhLap")):"")%>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" />
                                        </asp:TemplateField>
                                    </Columns>
                                    <EditRowStyle BackColor="#2461BF" />
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#EFF3FB" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                                </asp:GridView>
                            </div>
                        </div>
                    </div>
                </div>
            </asp:Panel>
            <asp:Panel ID="pngiaithedonvi" runat="server" Visible="false">
                <div class="row-fluid">
                    <div class="span12">
                        <div class="box">
                            <div class="box-title">
                                <h3><i class="icon-file"></i>Giải thể đơn vị</h3>
                                <div class="box-tool">
                                    <a data-action="collapse" href="#"><i class="icon-chevron-up"></i></a>
                                    <a data-action="close" href="#"><i class="icon-remove"></i></a>
                                </div>
                            </div>
                            <div class="box-content control-group info" style="border: 1px solid #B6D1F2;">
                                <label class="control-label" style="width:200px;padding-right:10px;">Số quyết định giải thể</label>
                                <input type="hidden" id="txtmadonvigiaithe" runat="server" />
                                <div class="controls">
                                    <asp:TextBox ID="txtSoQuyetDinh" runat="server" CssClass="span3" onblur="KiemTraInjection(this);"></asp:TextBox>
                                </div>
                                <div style="height:5px;"></div>
                                <label class="control-label" style="width:200px;padding-right:10px;">Ngày giải thể</label>
                                <div class="controls">
                                    <asp:TextBox ID="txtNgayGiaiThe" runat="server" CssClass="span3" onblur="KiemTraInjection(this);"></asp:TextBox>
                                    <asp:ImageButton runat="Server" ID="Image1" ImageUrl="~/css/icons/lich.gif" AlternateText="Click to show calendar" />
                                    <ajaxToolkit:CalendarExtender ID="calendarButtonExtender2" runat="server" TargetControlID="txtNgayGiaiThe" PopupButtonID="Image1" Format="dd/MM/yyyy" />
                                </div>
                                <div style="height:5px;"></div>
                                <label class="control-label" style="width:200px;padding-right:10px;">Lý do bị giải thể</label>
                                <div class="controls">
                                    <asp:TextBox ID="txtLyDo" runat="server" CssClass="span5" TextMode="MultiLine" Height="50px" onblur="KiemTraInjection(this);"></asp:TextBox>
                                </div>
                                <div style="height:5px;"></div>
                                <label class="control-label" style="width:200px;padding-right:10px;"></label>
                                <div class="controls">
                                    <asp:LinkButton ID="btnsavegiaithe" OnClick="btnsavegiaithe_Click" class="btn btn-primary"  runat="server" Width="60px"><i class="icon-save"></i>&nbsp;&nbsp;Lưu</asp:LinkButton>
                                    <asp:LinkButton ID="btnclosegiaithe" runat="server" OnClick="btnclosegiaithe_Click" CssClass="btn btn-danger"><i class="icon-signout"></i>&nbsp;&nbsp;Đóng</asp:LinkButton>
                                    <asp:Label ID="lblstatus" runat="server" ForeColor="Red"></asp:Label>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </asp:Panel>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnedit" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btndanhgia" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btndelete" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
    <asp:UpdateProgress ID="udtprogress" runat="server" AssociatedUpdatePanelID="udt1">
        <ProgressTemplate>
            <div class="progress">
                <img src="../img/ajax-loader.gif" />
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <script type = "text/javascript">
        function RadioCheck(rb)
        {
            var gv = document.getElementById("<%=grid.ClientID%>");
            var rbs = gv.getElementsByTagName("input");
             var row = rb.parentNode.parentNode;
             for (var i = 0; i < rbs.length; i++)
             {
                 if (rbs[i].type == "radio") {
                     if (rbs[i].checked && rbs[i] != rb) {
                         rbs[i].checked = false;
                         break;
                     }
                 }
             }
         }
    </script>
    <br><br><br><br><br><br><br><br><br><br><br><br>
    <br><br><br><br><br><br><br><br><br><br><br><br>
</asp:Content>

